package com.neusoft.bizcore.auth.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@Table(name = "bizcore_auth_dinguser")
public class DingUser extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    /** 钉钉UserID */
    @NotBlank(message = "钉钉用户ID不能为空")
    @Length(max = 50, message = "钉钉用户ID不能超过{max}位")
    @Column(length = 50, nullable = false, unique = true)
    private String dingUserId;

    /** 关联系统用户 */
    @NotNull
    @OneToOne
    private AuthUser user;

}
